from fastapi import APIRouter
from utils.logger_util import save_data_log_s8_mongo, save_data_log_s8_health_mongo

s8_router = APIRouter(prefix='/test/wristband/s8', tags=['手环', 'S8'])


@s8_router.post("/location")
async def location(data: dict) -> dict:
    """
    处理定位数据接口。
    """
    print(data)
    await save_data_log_s8_mongo(data)
    return {"flag": 1, "msg": "成功", "obj": {"test": 1}}


@s8_router.post("/health")
async def health(data: dict) -> dict:
    """
    处理定位数据接口。
    """
    await save_data_log_s8_health_mongo(data)
    return {"flag": 1, "msg": "成功", "obj": {"test": 1}}